<%@ page import="java.io.*, java.util.*"%>
<%@ page import="java.util.Enumeration"%>
<%@ page import="java.util.Collections"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<%@ page import="org.tools.wstt.session.SessionObject"%>

<c:set var="title" scope="request">Test the Behavior of Sessions</c:set>

<jsp:include page="/WEB-INF/jsp/inc/head.jsp" />
<%
	if(request.getSession() != null && request.getSession().getAttribute("SessionObject") == null) {
		SessionObject vTmpSO = new SessionObject();
		request.getSession().setAttribute("SessionObject", vTmpSO);
	}

	SessionObject vSO = (SessionObject) request.getSession().getAttribute("SessionObject");
	if(vSO != null) {
		vSO.testLogger("from JSP");
	}
	
	request.setAttribute("dateValue", new java.util.Date(request.getSession().getCreationTime()));
%>

<h2>Session Creation</h2>
<p><em>This page aims to create a session on this web server. Its content is simple and allows replication and serialization tests. See below.</em></p>
<h3>Session Properties</h3>
<dl>
	<dt>ID</dt><dd><code><%=request.getSession().getId()%></code></dd>
	<dt>Creation Time</dt><dd><code><fmt:formatDate value="${dateValue}" pattern="MM/dd/yyyy HH:mm:SS" timeZone="GMT+2" /></code></dd>
	<dt>Expiration duration</dt><dd><code><%=request.getSession().getMaxInactiveInterval()%></code></dd>
</dl>

<h2>Session Content and Clusterable check</h2>

<jsp:include page="serialization.jsp" />

<jsp:include page="/WEB-INF/jsp/inc/foot.jsp" />